package net.zjitc.service.impl;

import net.zjitc.dao.ProductDao;
import net.zjitc.dao.impl.ProductDaoImpl;
import net.zjitc.domain.Product;
import net.zjitc.service.ProductService;
import net.zjitc.utils.PageBean;

import java.util.List;

/**
 * Created by rj1502 on 2017/10/23.
 */
public class ProduceServiceImpl implements ProductService{
    //成员变量，所有的方法都可以用
    ProductDao dao = new ProductDaoImpl();

    @Override
    public List<Product> findAll() {

        return dao.findAll();
    }

    @Override
    public int insert(Product product) {

        return dao.insert(product);

    }

    @Override
    public Product findById(int pid) {

        return dao.findById(pid);
    }

    @Override
    public int update(Product p) {
        return dao.update(p);
    }

    @Override
    public List<Product> findByCondition(String condition) {
        return dao.findByCondition(condition);
    }

    @Override
    public PageBean<Product> findPage(int currentPage, int pageSize) {
        return dao.findPage(currentPage,pageSize);
    }
}
